from dajax.core import Dajax
from dajaxice.decorators import dajaxice_register
from dajaxice.utils import deserialize_form

from django.template.loader import render_to_string
from .models import Profile

@dajaxice_register
def multiply(request):
    dajax = Dajax()
    profile = Profile.objects.get(user__username="hanattaw")
    template_name='profiles/ajax_profile_detail.html'
    render = render_to_string(template_name, {'profile': profile})
    #dajax.assign('#details', 'innerHTML', render)
    dajax.alert(request.user.username)
    return dajax.json()